# -*- coding: utf-8 -*-

def pingfang(n):
##    1929374254627488900
##    1_2_3_4_5_6_7_8_9_0
##    0123456789012345678
    m = n * n
    strm = str(m)
    if strm[18] == '0' and \
       strm[16] == '9'and \
       strm[14] == '8'and \
       strm[12] == '7'and \
       strm[10] == '6'and \
       strm[8]  == '5'and \
       strm[6]  == '4'and \
       strm[4]  == '3'and\
       strm[2]  == '2'and\
       strm[0]  == '1':
        print n,m,len(strm)
        return 1
    return 0

def main():
    n = 1389019160
    n = 1000000000
    while 1:
        n += 10
        if pingfang(n):
            break

if __name__ == '__main__':
##    1389019170 1929374254627488900 19
##Execution time: 0.0450000762939 seconds
    import time
    start = time.time()
    main()
    print('Execution time: {0} seconds'.format(time.time() - start))
